package com.xu.rag.controller;

import com.xu.rag.pojo.req.ChatReq;
import com.xu.rag.service.TestService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.validation.Valid;


/**
 * @Author: xdl
 * @CreateTime: 2025-01-13 23:18
 * @Description:
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private TestService testService;

    @PostMapping("embedding")
    public String embedding(MultipartFile file) {
        return testService.embedding(file);
    }

    @PostMapping("chat")
    public String chat(@RequestBody @Valid ChatReq chatReq) {
        return testService.chat(chatReq);
    }

}
